package com.t2t.top.service.impl;

import com.t2t.top.framework.log.LogTrace;
import com.t2t.top.model.po.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.support.MethodReplacer;

import java.lang.reflect.Method;

public class MethodReplace implements MethodReplacer {
    Logger logger = LoggerFactory.getLogger(this.getClass());

    @LogTrace
    public Object reimplement(Object obj, Method method, Object[] args)throws Throwable {
        logger.info("方法已经被替换!");
        User u = new User();
        u.setName("ypf");
        return u;
    }
}